/*
 * CopyLeft (c) 2001->infinity by Michael U. Bergens for starters.
 *
 *   Long story short: Apache 2.0, no warranty whatsoever, no obligations
 *   of any kind on the part of the authors nor on the part of the consumers of this code.
 */
package org.michael.u.brg.by.sys;

import java.io.InputStream;
import java.util.LinkedList;
import java.util.List;

/**
 * @author Michael Bergens
 */
public class ListStreamConsumer extends IoStreamConsumer {

    private final List<String> content;

    private final List<Exception> errors = new LinkedList<Exception>();

    public ListStreamConsumer(InputStream inputStream) {
        super(inputStream);
        content = new LinkedList<String>();
    }

    public List<String> getContent() {
        return content;
    }

    public List<Exception> getErrors() {
        return errors;
    }

    @Override
    public void consume(String text) {
        content.add(text);
    }

    @Override
    public void recordException(Exception exception) {
        errors.add(exception);
    }

}
